package practice;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class p006 {
    public static void main(String[] args) {
        FileInputStream fis = null;
        try {
           fis = new FileInputStream("F:\\untitled\\src\\practice\\temp001.txt");
            byte[] bytes = new byte[4];
            while(true){
                int data = fis.read(bytes);
                if(data == -1){
                    break;
                }
                System.out.println(new String(bytes, 0,data));
            }
        }
        catch (FileNotFoundException e ){
            e.printStackTrace();

        }
        catch (IOException e ){
            e.printStackTrace();
        }
        finally{
            if(fis != null){
                try {
                fis.close();
                }
                catch (IOException  e){
                    e.printStackTrace();
                }
            }

        }
    }
}
